server {
    listen 80;
    server_name www.besteasylearn.com;

    add_header Access-Control-Allow-Origin *;
    add_header Access-Control-Allow-Headers X-Requested-With;
    add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
    
    lua_code_cache off;  

    add_header X-Frame-Options ALLOWALL;

    location / {

        default_type 'text/plain';

        lua_code_cache off;  
        content_by_lua_block {
            ngx.say('hello openresty-lua')
        }   
    }


    location /bo_live/ {
        proxy_pass http://47.98.187.80:3000/;
    }


    location /qiniu_test/ {
      
        alias /opt/andrew_git/QiNiuWeb/;
        autoindex on;                          
        autoindex_exact_size off;  
        autoindex_localtime on;  
    }

    #location ~ \.(json) {
    #    default_type  application/json;
    #    alias /opt/andrew_git/QiNiuWeb/;
    #}

    
    

    location /sky/ {
    

        proxy_pass http://47.98.187.80:8083/;
    }
    

    # /versionTest/card/index.html?v=1.0.0  to versionTest/card/1.0.0/index.html
    location /versionTest2/ {
		
        if ($request_uri ~* "^/versionTest2/(.*)\?v=(.*)$") {
            set $version $2;
            set $beforePath $1;
            rewrite .* /versionTest/$version/$beforePath? last;
        }
    }

    location /versionTest/ {
        alias /opt/andrew_git//versionTest/;
    }

    location /qisun_app/ {
        index index.html;
        alias /opt/andrew_git/qisun_app/app/dist/; 
    }

    location /qisun_app/api/ {
        proxy_pass http://api.crap.cn/;
    }


    location /abc {
        proxy_pass http://www.baidu.com/;
    }



}  
